package com.example.lenovo.findmyclass.Menu;

import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;

import com.example.lenovo.findmyclass.MainActivity;
import com.example.lenovo.findmyclass.R;
import com.example.lenovo.findmyclass.RegisterActivity;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Locale;


public class PersonalData extends Activity {
    private Button back;
    private TextView consultation_tv_birthdate,tv_name,tv_nickname,tv_phone_number;
    private Button revise;
    private int mYear,mMonth,mDay;
    public static String name,nickname,birthdate,phoneNumber;
    DateFormat format = DateFormat.getDateInstance();
    Calendar calendar = Calendar.getInstance(Locale.CHINA);
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_personal_data);
        final Calendar ca = Calendar.getInstance();
        mYear = ca.get(Calendar.YEAR);//年
        mMonth = ca.get(Calendar.MONTH);//月
        mDay = ca.get(Calendar.DAY_OF_MONTH);//日
        consultation_tv_birthdate=findViewById(R.id.birthday_tv);
        consultation_tv_birthdate.setText(birthdate);
        tv_phone_number=findViewById(R.id.tv_phone_number);
        tv_phone_number.setText(phoneNumber);
        tv_name=findViewById(R.id.tv_name);
        tv_name.setText(name);
        tv_nickname=findViewById(R.id.tv_nickname);
        tv_nickname.setText(nickname);
        revise=findViewById(R.id.revise);
        revise.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent revise = new Intent(PersonalData.this,ReviseData.class);
                startActivity(revise);
            }
        });

        back=findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(PersonalData.this, MainActivity.class);
                startActivity(intent);
            }
        });
    }
}
